<template>
	<div class="bigDiv">
		<div style="margin: 10px auto 30px 40px;font-size: 25px;color: #004c70;font-weight: bold;">
			各组织购买情况总览(有效订单不含预占 单位/元)
		</div>
		<el-row>
			<el-col :span="20">
				<el-table :data="list" border :cell-style="setRowStyle" height="calc(100vh - 230px)"
					:header-cell-style="{fontSize:'15px',background:'#daf3ff',height:'70px',color:'#fff',border: '0.3px solid #afe1e1'}">
					<el-table-column label="时间" align="center" prop="date" margin: auto></el-table-column>
					<el-table-column label="攀钢" align="center" prop="攀钢" margin: auto></el-table-column>
					<el-table-column label="本钢" align="center" prop="本钢" margin: auto></el-table-column>
					<el-table-column label="矿业" align="center" prop="矿业" margin: auto></el-table-column>
					<el-table-column label="集团+其他板块" align="center" prop="集团+其他板块" margin: auto></el-table-column>
					<el-table-column label="鞍山钢铁" align="center" prop="鞍山钢铁" margin: auto></el-table-column>
					<el-table-column label="合计" align="center" prop="sum2" margin: auto></el-table-column>
				</el-table>
			</el-col>
			<el-col :span="3">
				<el-table :data="listAll" border :cell-style="setRowStyle2" height="calc(100vh - 230px)"
					:header-cell-style="{fontSize:'15px',background:'#daf3ff',height:'70px',color:'#fff',border: '0.3px solid #afe1e1'}">
					<el-table-column label="所有组织金额(总金额)" align="center" prop="全部板块" margin: auto></el-table-column>
				</el-table>
			</el-col>
		</el-row>
	</div>
</template>

<script>
	import {
		getPurchaseBuyCountEsay,
		getPurchaseBuyCountEsayAll
	} from "@/api/leader/leaderapi";
	export default {
		name: "",
		// 页面数据
		data() {
			return {
				list: [],
				total: 0, // 一共多少条数据
				timeModel: []
			};
		},
		// 初始化
		mounted() {
			this.getDate();
			console.log('60', this.list);
		},
		// 函数集合
		methods: {
			getDate() {
				//本年商品类别销售金额
				getPurchaseBuyCountEsay().then(res => {
					this.list = res
					console.log('67', this.list);
				})
				//所有组织总金额
				getPurchaseBuyCountEsayAll().then(res => {
					this.listAll = res
					console.log('60', this.listAll);
				})
			},
			//不同列显示颜色
			setRowStyle({
				row,
				column,
				rowIndex,
				columnIndex
			}) {
				if (columnIndex == 0) {
					return 'background: #f4ffff'
				}
				if (columnIndex == 6) {
					return 'background: #ff625d'
				}
			},

			setRowStyle2({
				row,
				column,
				rowIndex,
				columnIndex
			}) {
				if (columnIndex == 0) {
					return 'background: #e9ffe5'
				}
			}

		}
	}
</script>

<style>
	::v-deep.el-table td {
		border: 1px solid black;
		border-right: none !important;
	}
</style>
